The Absolute Beginners Guide To Amos ------------------------------------- Chapter thirteen ---------------- In this chapter, as promised earlier, we take a look at customizing our own screens. But first, the answers to self test quiz number 3: 1. A 6. C 2. B 7. C 3. C 8. C 4. A 9. A 5. C 10. C --------------------------------------------------------------------------- EXAMPLE13.Amos is a small demonstration of opening screens of different sizes, colours and resolutions, why would we want to do that? Well let us say you were writing a word processor program. If you were to use Amos`s default screen of 40 characters across it would look pretty shoddy against a nice 80 column text display which is very easy to set up. There are many more uses which I do not want to go into yet to save you confusion. Let us get on with the SCREEN OPEN command. SCREEN OPEN 0,320,200,16,lowres The above line simulates the Amos default screen we have been using in all of our example programs so far. The 0 is just an I.D number so you can keep track of your screens if you have more than one screen open at a time. You can have up to eight screens open at once, numbered 0-7. The 320 is the width in pixels of our requested screen, if we changed this to say 160, only half of our T.V screen would be used by our program (left half) There is no real limit to the width of our screen, but for now we are best off to stick to a maximum of 320 in lowres and 640 in hires. The 16 is the number of colours we wish to be available to us, remember the more colours you employ the more memory you use and a possibility of slowing some programs down. As a rule most people tend to use 4,8,16 or 32 colours for their screens. There are some limits to the amount of colours you can use in hires but I would advise a maximum of eight. LOWRES: There are only two options here LOWRES and HIRES. Rather than explain the difference again take a look at EXAMPLE13.Amos and you will understand. That is Amos`s default screen that we use. Here are the custom screens used in EXAMPLE13.Amos SCREEN OPEN 0,250,80,4,lowres ----------------------------- Screen I.D = 0 Width = 250 pixels across height = 80 pixels top to bottom Colours = 4, using 0 to 3 Mode = Lowres SCREEN OPEN 0,640,256,8,hires ----------------------------- Screen I.D = 0 Width = 640 pixels across height = 256 pixels top to bottom Colours = 8, using 0 to 7 Mode = Hires (80 column text, 0-79) Make notes of the five attributes of SCREEN OPEN for future reference and you won`t go far wrong. Experiment with EXAMPLE13.Amos and see what weird and wonderful screens you can come up with. SCREEN DISPLAY ============== Take a look at EXAMPLE13_1.Amos for a demonstration of how SCREEN DISPLAY works. This command allows us to position a previously defined screen to anywhere on the TV display. This is the syntax of the command. SCREEN DISPLAY N,X,Y,W,H -------------------------- don`t be put off yet because it looks odd, I will break this down for you. N --- is the number of the screen you wish to position. Say for example we had two screens open, 0 and 1, and we want to position screen 1 then we would put a 1 here. X --- X is the position across your TV screen, but this time just to confuse us the positioning isn`t in pixels or characters but in hardware coordinates. For the moment don`t worry about why just remember that your X must be in the range 112 to 448, 112 being the left edge of the screen. Y --- Y is also in hardware coordinates. This tells SCREEN DISPLAY how far down the display we want to position our new screen. The limits here are 0 to 312, with 0 being the top of the T.V screen. W,H --- Width, Height, we can leave these out luckily because SCREEN DISPLAY will use the Width and Height of our previously opened custom screen so all we need in W and H's place are two commas like this ,, In EXAMPLE13_1 another new command appears, this the SCREEN command and instructs Amos as to which screen we want to use if we have more than one screen open. For example if we did: SCREEN OPEN 0,228,80,4,lowres SCREEN OPEN 1,150,100,8,lowres Amos would now use screen one as the current screen so if for example we did PRINT "HELLO" the words HELLO would appear in screen 1. This is where the SCREEN command comes in. What if we wanted the words HELLO printed on screen 0? We just issue the command: SCREEN 0 And Amos will now use SCREEN 0 as the current screen. The SCREEN OFFSET instruction has many uses and lots of different and startling effects can be achieved with it. But this is as far as we will go for now with screen commands as we have begun to stretch the limits of a beginners course in Amos. Here are a few more SCREEN related commands that are easy to use that you may want to investigate further. SCREEN HIDE : Literally HIDE a screen from the users view. SCREEN SHOW : Bring the hidden screen back H=SCREEN HEIGHT : H returns the height of the current screen W=SCREEN WIDTH : W returns width C=SCREEN COLOUR : C returns amount of colours used by current screen SCREEN CLOSE N : Deletes SCREEN number N and frees up the memory it used End of chapter thirteen ^^^^^^^^^^^^^^^^^^^^^^^